export function createReducer(handlers, initialState) {
  return (state, action) => {
    if (state === undefined) {
      state = initialState;
    }
    if (handlers.hasOwnProperty(action.type)) {
      return handlers[action.type](state, action);
    } else {
      return state;
    }
  };
}
